﻿using System;
using System.Web.Services;
using System.Xml.Serialization;

using SBPweb.Twitter.Host.Connectivity;
using SBPweb.Twitter.Host.Session;
using SBPweb.Twitter.Host.Stanzas;

namespace SBPweb.Twitter.Host.Services
{
    /// <summary>
    /// Summary description for Authentication
    /// </summary>
    [WebService(Namespace = "http://iwiw.sbpweb.hu/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class Authentication : System.Web.Services.WebService
    {

        [WebMethod]
        [XmlInclude(typeof(UserTimeLine))]
        public ServiceMethodResult SignIn(string email, string password)
        {
            ServiceMethodResult smr = new ServiceMethodResult(ServiceResultCode.Ok, null);

            try
            {
                smr.Value = SessionManager.WebClient.SignIn(email, password);
            }
            catch (Exception ex)
            {
                smr.Code = ServiceResultCode.Error;
                smr.Value = ex;
            }

            return smr;
        }

    }
}
